package com.ktjy.goods.controller;


import com.ktjy.common.annotation.Log;
import com.ktjy.common.core.controller.BaseController;
import com.ktjy.common.core.domain.AjaxResult;
import com.ktjy.common.enums.BusinessType;
import com.ktjy.goods.domain.TGoodsAttrValues;
import com.ktjy.goods.domain.TGoodsInfo;
import com.ktjy.goods.service.ITGoodsAttrValuesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-18
 */
@RestController
@RequestMapping("/goods/goodsAttrValues")
public class TGoodsAttrValuesController extends BaseController {

    @Autowired
    private ITGoodsAttrValuesService itGoodsAttrValuesService;

    @PreAuthorize("@ss.hasPermi('goods:goodsAttrValues:add')")
    @Log(title = "商品信息", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody TGoodsAttrValues tGoodsAttrValues)
    {
        System.out.println("tGoodsAttrValuesAdd--------------------------------");
        return toAjax(itGoodsAttrValuesService.save(tGoodsAttrValues));
    }

    @PreAuthorize("@ss.hasPermi('goods:goodsAttrValues:remove')")
    @Log(title = "规格属性", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable List<Integer> ids)
    {
        return toAjax(itGoodsAttrValuesService.removeByIds(ids));
    }
}
